package ucd.csi.comp30220.fall2011.oteop.flight;

import java.io.Serializable;

/**
 * A Plane is really just a collection of attributes, it needs a pilot to get in
 * the air and (hopefully) stay there.
 * 
 * @author David Harrison
 */
public final class PlaneInfo implements Serializable {

    private static final long serialVersionUID = -6397430131761157422L;
    
    private String type; 
    private int serviceCeiling; 
    private int cruisingAltitude; 
    private int rateOfClimb; 
    private int maximumSpeed; 
    private int stallSpeed; 
    private int cruisingSpeed; 
    private int rotateSpeed; 
    private int approachSpeed; 
    private int landingSpeed; 
    private int range; 
    private int takeoffDistance; 
    private int landingDistance;
    
    public PlaneInfo(
            String type,
            int serviceCeiling,
            int cruisingAltitude,
            int rateOfClimb,
            int maximumSpeed,
            int stallSpeed,
            int cruisingSpeed,
            int rotateSpeed,
            int approachSpeed,
            int landingSpeed,
            int range,
            int takeoffDistance,
            int landingDistance) {
        this.type = type;
        this.serviceCeiling = serviceCeiling;
        this.cruisingAltitude = cruisingAltitude;
        this.rateOfClimb = rateOfClimb;
        this.maximumSpeed = maximumSpeed;
        this.stallSpeed = stallSpeed;
        this.cruisingSpeed = cruisingSpeed;
        this.rotateSpeed = rotateSpeed;
        this.approachSpeed = approachSpeed;
        this.landingSpeed = landingSpeed;
        this.range = range;
        this.takeoffDistance = takeoffDistance;
        this.landingDistance = landingDistance;
    }
    
    /** @returns "Boeing 747-400" or similar */
    public String getType() {
        return type;
    }
    
    /** @returns max altitude (feet) */
    public int getServiceCeiling() {
        return serviceCeiling;
    }
    
    /** @returns optimum altitude for cruising (feet) */
    public int getCruisingAltitude() {
        return cruisingAltitude;
    }
    
    /** @returns how fast the plane can climb (feet/min) */
    public int getRateOfClimb() {
        return rateOfClimb;
    }
    
    /** @returns maximum speed (knots) */
    public int getMaximumSpeed() {
        return maximumSpeed;
    }
    
    /** @returns speed at which plane will stall (knots) */
    public int getStallSpeed() {
        return stallSpeed;
    }
    
    /** @returns optimum speed for cruising (knots) */
    public int getCruisingSpeed() {
        return cruisingSpeed;
    }
    
    /** @returns optimum speed for take off (knots) */
    public int getRotateSpeed() {
        return rotateSpeed;
    }
    
    /** @returns optimum airport approach speed (knots) */
    public int getApproachSpeed() {
        return approachSpeed;
    }
    
    /** @returns optimum landing speed (knots) */
    public int getLandingSpeed() {
        return landingSpeed;
    }
    
    /** @returns safe operating range (nautical miles) */
    public int getRange() {
        return range;
    }
    
    /** @returns minimum runway length required to take off (feet) */
    public int getTakeoffDistance() {
        return takeoffDistance;
    }
    
    /** @returns minimum runway length required to land (feet) */
    public int getLandingDistance() {
        return landingDistance;
    }

    public String toString() {
        return "PlaneInfo [type=" + type + ", serviceCeiling=" + serviceCeiling
                + ", cruisingAltitude=" + cruisingAltitude + ", rateOfClimb="
                + rateOfClimb + ", maximumSpeed=" + maximumSpeed
                + ", stallSpeed=" + stallSpeed + ", cruisingSpeed="
                + cruisingSpeed + ", rotateSpeed=" + rotateSpeed
                + ", approachSpeed=" + approachSpeed + ", landingSpeed="
                + landingSpeed + ", range=" + range + ", takeoffDistance="
                + takeoffDistance + ", landingDistance=" + landingDistance
                + "]";
    }
}
